home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / MC68000Test.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-19  |  3.0 KB  |  91 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Thursday, October 15, 1989 at 11:32 AM
  4.     MC68000Test.h
  5.     C Interface to routines to test to see if they are running on a MC68000 Processor
  6.  
  7.     Copyright Apple Computer, Inc. 1991
  8.     All rights reserved
  9.  
  10. ************************************************************/
  11.  
  12. #ifndef __MC68000Test__
  13. #define __MC68000Test__
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. /*
  20. The following routines are provided to the outside caller to handle checking to see if
  21. we are runing on the “proper” processor:
  22.  
  23. • To just do the check for the MC68000...
  24.  
  25.             Boolean onMC68000(void);
  26.             
  27. • To do the check for MC68000 for MPW tools and to abort with an error message to stderr
  28.     if we're on a MC68000...
  29.  
  30.             void abortToolOnMC68000(short exitCode);
  31.             
  32. • To do the check for MC68000 for MPW tools or applications and to abort with an alert
  33.     dialog if we're on a MC68000...
  34.     
  35.             void abortOnMC68000(void);
  36.  
  37. If the machine is an MC68000, then abortToolOnMC68000() and abortOnMC68000() generate the
  38. following message (appropriately formatted):
  39.  
  40.     “Sorry!  This program assumes an MC68020, MC68030, or MC68040 processor.  It cannot be
  41.      run on your MC68000 machine.”
  42.  
  43. There is a possible error condition where the processor cannot be determined using the
  44. SysEnvirons() system trap (on systems older than 4.1).  In that case the following message
  45. is generated:
  46.  
  47.     “Sorry! I cannot determine what processor you are running on!  Sinc this program assumes
  48.      you are running on an MC68020, MC68030, or MC68040 I am going to assume you have an
  49.      MC68000 so it cannot be run on your machine.”
  50.  
  51. Roughly, the cose of using abortToolOnMC68000() is about 750 bytes and abortOnMC68000()
  52. is about 1000 bytes.  By contrast, onMC68000(), which doesn't really do much of anything
  53. costs only about 100 bytes.
  54.  
  55. Note: these routines live in their own private segment, MC68000Test.  The caller might
  56. want to do an UnloadSeg() on return since these routines would normally only be called
  57. once.
  58. */
  59.  
  60. extern Boolean onMC68000(void);
  61.     /*
  62.     This routine returns true if we are currently running on an MC68000 and false otherwise.
  63.     It is provided for convenience for those callers who wish to take some more appropriate
  64.     actions based on the processor (other than just aborting with a canned error message).
  65.     */
  66.  
  67.  
  68. extern void abortToolOnMC68000(short exitCode);
  69.     /*
  70.     This routine aborts a MPW Shell tool if it's running on an MC68000 processor.  It is
  71.     assumed that we are being called by an MPW Shell tool.  It writes a message to stderr and
  72.     aborts the tool if we are on a MC68000.  The tool exit status code is specified by the
  73.     caller (in exitCode).  If 0 is specified, 1 will be used.
  74.     
  75.     If we are NOT on a MC68000, the routine simply returns to allow running of the tool.
  76.     */
  77.  
  78.  
  79. extern void abortOnMC68000(void);
  80.     /*
  81.     This routine aborts the calling program if it's running on an MC68000 processor.  The
  82.     caller can be either an MPW Shell tool OR a standard Mac application.  It displays a
  83.     message in an alert dialog and aborts if we are on a MC68000.  
  84.     */
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif
  91.